package com.zc.study.thread.多线程第三章节.thread3_1_2;

public class Thread1 extends Thread {
    private  Object object;

    public Thread1(Object object) {
        this.object = object;
    }

    @Override
    public void run() {
        super.run();
        System.out.println(
                "线程1开始运行"
        );
        synchronized (object){
            System.out.println("开始等待");
            try {
                object.wait(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("等待结束");
        }
        System.out.println("线程1结束");
    }
}
